package ar.edu.utn.frsf.cidisi.upcolbpip.edit.tools;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.ui.action.ValidateAction;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;

import ar.edu.utn.frsf.cidisi.upcolbpip.UPColBPIPModel;
import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.B2BCollaboration;
import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.CollaborativeBusinessProcess;
import ar.edu.utn.frsf.cidisi.upcolbpip.presentation.UpcolbpipActionBarContributor;
import ar.edu.utn.frsf.cidisi.upcolbpip.presentation.UpcolbpipModelWizard;

public class CustomDiagnostic {

	private Diagnostic diagnostic;
	
	public CustomDiagnostic(Object object) {

		ValidateAction validateAction = UpcolbpipActionBarContributor.getInstance().validateAction();
		
		EObject objectToValidate = (((UPColBPIPModel)((EObject) object).eResource().getContents().get(0)).getB2bCollaboration());
		UpcolbpipActionBarContributor.getInstance().setObject(objectToValidate);
		validateAction.run();
		
	}

	
	public Diagnostic getDiagnostic() {
		return diagnostic;
	}

}
